package com.yoshino.decorator;

/**
 * @author yoshino
 **/
public class Decorator extends Drink{
    private Drink obj;

    // 组合
    public Decorator(Drink obj) {
        this.obj = obj;
    }

    @Override
    public float cost() {
        // getPrice 自己价格
        return this.getPrice() + obj.cost();
    }

    @Override
    public String getDes() {
        return des + " " + getPrice() + " && " + obj.getDes();
    }
}
